import requests

def common_assert_search(resp, status_code, text):
    assert status_code == resp.status_code
    assert text in resp.text

if __name__ == '__main__':
    session = requests.Session()
    resp = session.get("https://cn.bing.com/search?q=宁宁")
    common_assert_search(resp, 200, "宁宁")

